import App from './App'
import uView from '@/uni_modules/uview-ui';
import Vue from 'vue'
import './uni.promisify.adaptor'
import httpApi from '@/common/request/http.api.js';
import httpInterceptor from '@/common/request/http.interceptor.js';
import utils from '@/common/utils/index.js';
import shareMixin from '@/common/mixins/share';
// 字典标签组件
Vue.config.productionTip = false;

import websocketUtil from '@/common/utils/websocketUtil.js' //引入websocket文件
Vue.prototype.$socket = websocketUtil; // websocket连接

Vue.prototype.$utils = utils; //工具类

//vuex
import store from '@/store/index.js'
Vue.prototype.$store = store

Vue.use(uView)

uni.$u.config.unit = 'rpx'

App.mpType = 'app'

const app = new Vue({
	store,
	...App
})

Vue.mixin(shareMixin);

Vue.use(httpInterceptor, app); // http拦截器，将此部分放在new Vue()和app.$mount()之间，才能App.vue中正常使用
Vue.use(httpApi, app); // http接口API抽离，免于写url或者一些固定的参数

app.$mount()